package PTA.Mianxiangduixiang.ex19;

import java.util.Scanner;
class Cylinder{
    private int radius;
    private int heigth;
private double s=0;
    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        this.radius = radius;
    }

    public int getHeigth() {
        return heigth;
    }

    public void setHeigth(int heigth) {
        this.heigth = heigth;
    }
    Cylinder(int radius,int heigth){

        this.radius=radius;
        this.heigth=heigth;
        System.out.println("Constructor with para");
    }
    Cylinder(){
        this.radius=2;
        this.heigth=1;
        System.out.println("Constructor with para");
        System.out.println("Constructor no para");
    }
    public int getVolumn(){
        s= Math.PI*radius*radius*heigth;
        return (int)s;
    }
}


public class ex19 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
int radius = sc.nextInt();
int height = sc.nextInt();
Cylinder c1 = new Cylinder(radius,height);//创建圆柱体对象c1,
        System.out.println(c1.getVolumn());
Cylinder c2 = new Cylinder();
        System.out.println(c2.getVolumn());

    }
}
